package com.kedacom.ctsp.authority.entity;


import com.kedacom.ctsp.web.entity.AbstractCrudEntity;
import com.kedacom.ctsp.web.entity.SortSupportBean;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * 角色
 *
 * @author
 */
@Data
@EqualsAndHashCode(of = "id")
@Entity
@Table(name = "role")
@ToString(exclude = {"users", "departments"})
public class SimpleRole extends AbstractCrudEntity<String> implements Role, SortSupportBean {
    /**
     * 主键id ，自增长
     */
    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    private String id;
    /**
     * 名称
     */
    private String name;
    /**
     * 标识
     */
    private String sign;

    /**
     * 描述
     */
    private String description;
    /**
     * 角色排序
     */
    private Long sortIndex;

    /**
     * 客户端标识
     */
    private String clientSign;
    /**
     * 扩展字段
     */
    @Column(length = 4000)
    private String extendedField;
}
